Skip to content

Conversation

@arunjose696
Copy link
Contributor

@arunjose696 arunjose696 commented May 22, 2025

DefaultRangeIndicator previously used Image(Device, ImageData) constructor to draw a grid to display the selected range.

Previously, the grid was rendered using a 1×1 pixel checkerboard pattern (blue and white), which was mainly inteded to work at 100% zoom. However, at higher zoom levels (e.g., 150%, 200%), the visual intensity of the pattern becomes different, causing the grid to appear visually inconsistent across zooms.

Figures below uses Image(Device, ImageData)


200%

100%

The new implementation uses Image(Device, ImageDataProvider) adapts the grid's block size based on the zoom scale. Instead of always using 1×1 blocks, it calculates the block size by rounding the zoom factor:

For zoom levels like 100%, 125%, etc., block size = 1 (no change).

For higher zoom levels like 150%, 200%, etc., block size = 2.

This means the grid will now use 2×2 rectangles for higher zooms, resulting in a visual appearance that better matches how the original 1×1 pattern looks on standard (100%) displays. This preserves visual consistency across different zoom levels and monitor scaling settings.

Figures below Uses Image(Device, ImageDataProvider)


100%

125%

150%

175%

200%

Contributes to vi-eclipse/Eclipse-Platform#199

…/texteditor/DefaultRangeIndicator.java

Co-authored-by: Federico Jeanne <[email protected]>
@fedejeanne fedejeanne closed this May 22, 2025
@fedejeanne fedejeanne deleted the arun/199/rangeIndicator branch May 22, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluate calling places of Image constructors with ImageData

2 participants